#/bin/bash
rm libHello.h libHello.so
#
#LD="/Users/chenxin/Library/Android/sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-ld" \
CC=/Users/chenxin/Library/Android/sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-gcc \
GOOS=android  \
CXX=/Users/chenxin/Library/Android/sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-g++ \
CGO_CFLAGS=" --sysroot /Users/chenxin/Library/Android/sdk/ndk-bundle/platforms/android-19/arch-arm" \
CGO_LDFLAGS="--sysroot /Users/chenxin/Library/Android/sdk/ndk-bundle/platforms/android-19/arch-arm" \
GOARCH=arm \
GOARM=7 \
CGO_ENABLED=1 \
go build -v -x -buildmode=c-shared -o libHello.so main.go jnienv.go
#javac Hello.java
#java -Djava.library.path=. Hello